package com.qingzhuge.member.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.GsonBuilder;
import com.qingzhuge.dto.response.BaseResponseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author : zero.xiao
 * @description : 微信用户手机号信息  UserInfo
 * @date : 2018/10/18 0018 上午 11:20
 * @modified :
 * @since :
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class WxUserPhoneInfoResponse extends BaseResponseDto {
    private static final long serialVersionUID = -8014936809151003506L;
    private String phoneNumber;
    private String purePhoneNumber;
    private String countryCode;
    @JSONField(serialize = false)
    private Watermark watermark;

    public static WxUserPhoneInfoResponse fromJson(String json) {
        return new GsonBuilder().create().fromJson(json, WxUserPhoneInfoResponse.class);
    }

    @Data
    public static class Watermark {
        private String timestamp;
        private String appid;
    }
}
